<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

    protected function _initDoctype() {
        $this->bootstrap('view');
        $view = $this->getResource('view');
        $view->doctype('XHTML1_STRICT');
        $view->headLink()->appendStylesheet('/css/style.css');
        $view->headLink()->appendStylesheet('/css/jquery.tooltip.css');
        $view->headLink()->appendStylesheet('/css/smoothness/jquery-ui-1.7.2.custom.css');
        $view->headScript()->appendFile('http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js','text/javascript');
        $view->headScript()->appendFile('http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js','text/javascript');
        $view->headScript()->appendFile('/js/base.js','text/javascript');
        $view->headScript()->appendFile('/js/jquery.tooltip.min.js','text/javascript');
        
        $view->headMeta()->appendName('keywords', 'kws inserted here');
        $view->headMeta()->appendName('description', 'desc inserted here');
        $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8');
        $view->headMeta()->appendHttpEquiv('Content-Language', 'nl-NL');
        $view->headTitle('Looplijst standaard PRI&E');
    }

    protected function _initAutoload() {
        $autoloader = new Zend_Application_Module_Autoloader(array(
                        'namespace' => 'Default_',
                        'basePath'  => dirname(__FILE__),
        ));

        return $autoloader;
    }

    protected function _initNavigation() {
        $this->bootstrap('layout');
        $layout = $this->getResource('layout');
        $view = $layout->getView();
        $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
        $container = new Zend_Navigation($config);
        $view->navigation($container)->setAcl(new Tc_Acl())->setRole(Zend_Auth::getInstance()->getStorage()->read()->role);
    }

    protected function _initHelpers() {
        Zend_Controller_Action_HelperBroker::addPrefix('Tc_Helper');
    }

    protected function _initAcl() {
        $acl = new Tc_Acl();
        $aclHelper = new Tc_Helper_Acl(null, array('acl' => $acl));
        Zend_Controller_Action_HelperBroker::addHelper($aclHelper);
        
    }

    protected function _initJquery() {
        $this->bootstrap('layout');
        $layout = $this->getResource('layout');
        $view = $layout->getView();
        $view->addHelperPath("ZendX/JQuery/View/Helper", "ZendX_JQuery_View_Helper");
    }
}

